package com.xuhuan.client.business.splitfile.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xuhuan.client.business.splitfile.entity.FileSplitLog;
import com.xuhuan.client.business.splitfile.mapper.FileSplitLogMapper;
import com.xuhuan.client.business.splitfile.service.IFileSplitLogService;
import org.springframework.stereotype.Service;

/**
 * @Author huan.xu
 * @Date 2023/6/17 9:19
 * @Description
 */
@Service
public class FileSplitLogServerImpl extends
        ServiceImpl<FileSplitLogMapper, FileSplitLog> implements IFileSplitLogService {
    /**
     * 根据文件唯一标识查询
     *
     * @param fileMd5
     * @return
     */
    @Override
    public FileSplitLog getByFileMd5(String fileMd5) {
        LambdaQueryWrapper<FileSplitLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(FileSplitLog::getMd5, fileMd5);
        return baseMapper.selectOne(queryWrapper);
    }
}
